# Build script
Write-Host "Building Wake-On-LAN.exe..."

# Check if ps2exe module is installed
if (-not (Get-Module -ListAvailable -Name ps2exe)) {
    Write-Host "Installing ps2exe module..."
    Install-Module ps2exe -Scope CurrentUser -Force
}

# Build exe file
Write-Host "Building exe file..."
Invoke-PS2EXE -InputFile ".\Wake-On-LAN.ps1" -OutputFile ".\Wake-On-LAN.exe" -NoConsole -STA -icon huan.ico

Write-Host "Build completed!"